package net.lanelife.casino.common.entity.auditing;

import net.lanelife.casino.common.dubbo.RpcContextAttachment;

import org.springframework.data.domain.AuditorAware;

import com.alibaba.dubbo.rpc.RpcContext;

public class DefaultAuditorAware implements AuditorAware<String> {

	public String getCurrentAuditor() {
		String username = RpcContext.getContext().getAttachment(RpcContextAttachment.ATTR_NAME_USERNAME);
		return null == username ? "SYSTEM" : username;
	}

}
